<template>
	<view class="page">
		<xzfx-panel v-if="form" title="意向车信息" isCard>
			<view class="xzfx-form" slot="content">
				<view class="xzfx-form-item">
					<view class="xzfx-form-label">意向品牌</view>
					<view class="xzfx-form-value">{{ form.purposeTruckBrand || "" }}</view>
				</view>
				<view class="xzfx-form-item">
					<view class="xzfx-form-label">意向车型</view>
					<view class="xzfx-form-value">{{ form.purposeTruckType || "" }}</view>
				</view>
				<view class="xzfx-form-item">
					<view class="xzfx-form-label">发动机品牌</view>
					<view class="xzfx-form-value">{{ form.purposeEngineBrand || "" }}</view>
				</view>
				<view class="xzfx-form-item">
					<view class="xzfx-form-label">购车预算</view>
					<view class="xzfx-form-value">{{ form.purposePrice || "" }}万元</view>
				</view>
			</view>
		</xzfx-panel>
		<xzfx-panel v-if="form" title="旧车信息" isCard>
			<view class="xzfx-form" slot="content">
				<view class="xzfx-form-item">
					<view class="xzfx-form-label">品牌</view>
					<view class="xzfx-form-value">{{ form.oldTruckBrand || "" }}</view>
				</view>
				<view class="xzfx-form-item">
					<view class="xzfx-form-label">车型</view>
					<view class="xzfx-form-value">{{ form.oldTruckType || "" }}</view>
				</view>
				<view class="xzfx-form-item">
					<view class="xzfx-form-label">上牌时间</view>
					<view class="xzfx-form-value">{{ form.oldLicenceDate || "" }}</view>
				</view>
				<view class="xzfx-form-item">
					<view class="xzfx-form-label">排放标准</view>
					<view class="xzfx-form-value">{{ form.oldEmissionStandard || "" }}</view>
				</view>
				<view class="xzfx-form-item">
					<view class="xzfx-form-label">表里程</view>
					<view class="xzfx-form-value">{{ form.oldShowMiles || "" }}万公里</view>
				</view>
				<view class="xzfx-form-item">
					<view class="xzfx-form-label">车架号</view>
					<view class="xzfx-form-value">{{ form.oldVinCode || "" }}</view>
				</view>
				<view class="xzfx-form-item">
					<view class="xzfx-form-label">发动机品牌</view>
					<view class="xzfx-form-value">{{ form.oldEngineBrand || "" }}</view>
				</view>
				<view class="xzfx-form-item">
					<view class="xzfx-form-label">旧车估价</view>
					<view class="xzfx-form-value">{{ form.oldValuationPrice || "" }}万元</view>
				</view>
			</view>
		</xzfx-panel>
		<xzfx-panel v-if="form" title="联系人信息" isCard>
			<view class="xzfx-form" slot="content">
				<view class="xzfx-form-item">
					<view class="xzfx-form-label">联系人</view>
					<view class="xzfx-form-value">{{ form.contackName || "" }}</view>
				</view>
				<view class="xzfx-form-item">
					<view class="xzfx-form-label">联系电话</view>
					<view class="xzfx-form-value">{{ form.contackPhone | _maskPhone }}</view>
				</view>
				<view class="xzfx-form-item">
					<view class="xzfx-form-label">联系地点</view>
					<view class="xzfx-form-value">{{ form.province || "" }}{{ form.city || "" }}{{ form.district || "" }}</view>
				</view>
				<view class="xzfx-form-item">
					<view class="xzfx-form-label">详细地址</view>
					<view class="xzfx-form-value">{{ form.location || "" }}</view>
				</view>
				<view class="xzfx-form-item">
					<view class="xzfx-form-label">经销商</view>
					<view class="xzfx-form-value">{{ form.agentName || "" }}</view>
				</view>
			</view>
		</xzfx-panel>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				form: null
			};
		},
		onLoad(e){
			this.$utils.system.loading("加载中，请稍后");
			this.$apis.carReplace.getDetails(e).then(res => {
				this.form = res;
			}).catch(err => {
				console.log(err)
			}).finally(() => {
				uni.hideLoading();
			});
		}
	}
</script>

<style scoped lang="scss">
	.page{
		padding-bottom: 50rpx;
	}
	.xzfx-form{
		padding-top: 20rpx;
		.xzfx-form-item{
			width: 100%;
			height: 90rpx;
			display: flex;
			align-items: center;
			border-top: 1rpx solid #f1f1f1;
			.xzfx-form-label{
				position: relative;
				width: 220rpx;
				padding-left: 18rpx;
				font-size: 30rpx;
				color: #333333;
			}
			.required::before{
				position: absolute;
				left: 0;
				content: "*";
				color: red;
			}
			.xzfx-form-value{
				width: calc(100% - 220rpx);
				text-align: right;
			}
		}
		.xzfx-form-item:first-child{
			border-top: none;
		}
	}
</style>